<?php
namespace Home\Controller;
use Think\Controller;
class NewController extends Controller {
	
	protected function _initialize(){
		
		//获取站点配置
		$this->opt = D('Options')->getOpts();
		
		$this->assign(array(
			'source'=>C('resource'),
			'opt'=>$this->opt
		));
		
		
	}  
	
	//显示文章内容
	public function index(){
		 
		$id = I('id',0,'intval');
        $row = M('NewsReply')->where("id = %d",$id)->find();
        if (!empty($row['url'])) {
            header("Location: ".$row['url']);
        }
        $this->assign(array(
            'row'=>$row,
        ));
       
		$this->display('index');
	}

	
	
}